package com.mdd.admin.validate.system;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;

/**
 * 支付配置参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SystemDevPayParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @NotEmpty(message = "支付名称不能为空", groups = {create.class, update.class})
    @Length(max = 32, message = "name参数不能超出32个字符", groups = {create.class, update.class})
    private String name;

    @NotNull(message = "payWay参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {1, 2, 3}, message = "payWay参数值不在符合范围", groups = {create.class, update.class})
    private Integer payWay;

    private String config;

    @Length(max = 255, message = "image参数不能超出255个字符", groups = {create.class, update.class})
    private String image;

    @DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
    private Integer sort;

}
